function msg_using_pocs = pocs_bpsk(x,fc)


onebit=101; %number of samples per bit
n=(length(x))/onebit; %number of bits transmitted
b=onebit;
c=1;
msg_using_pocs=[];
q = [];

for m=1:n; %iteration from 1 to number of bits
    y=x(c:b); % take the needed signal for one bit
    f=cos(2*pi*fc*(0:100));%reference signal for Quadrature
    g=cos(2*pi*fc*(0:100)+pi);%reference signal for Inphase
    a=y.*f; % (received signal) . (reference signal for Quadrature)
    d=y.*g; % (received signal) . (reference signal for Inphase)
    t= sum(a)-sum(d); %constellation
    if t>0;
        msg_using_pocs = [msg 1]; %accumulate the value of output into msg
    else
        msg_using_pocs = [msg -1]; %accumulate the value of output into msg
    end
    
    %----------POCS-----POCS--------%
    i_max = 2;
    i=1;
    G=2;
    
    
    for i=1:6
         q = [q msg_using_pocs(m)*exp(-j*2*pi*w*k/6);
    end
%              
%     
%     test =[];
%     while (i <i_max)
%         test(1,i)=1;
%         i=i+1;
%     end
    
    
    
    
    
    
    b=b+onebit; %update the value of b for the next input
    c=c+onebit; %update the value of c for the next input
end